package com.base.taskreports.reports.controller;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.base.taskreports.common.annotation.Resubmit;
import com.base.taskreports.common.annotation.TBatchLog;
import com.base.taskreports.common.utlis.DateUtil;
import com.base.taskreports.common.utlis.response.Result;
import com.base.taskreports.reports.entiyt.jfs.TblChaccCommPriAcctInfEntity;
import com.base.taskreports.reports.entiyt.jfs.TblCqpntPointInFlowEntity;
import com.base.taskreports.reports.entiyt.jfs.TblPointActivityEntity;
import com.base.taskreports.reports.entiyt.master.TIndicatorsEntity;
import com.base.taskreports.reports.service.TIndicatorsService;
import com.base.taskreports.reports.service.TblChaccCommPriAcctInfService;
import com.base.taskreports.reports.service.TblCqpntPointInFlowService;
import com.base.taskreports.reports.service.TblPointActivityService;
import com.base.taskreports.task.service.JfsService;

import lombok.extern.slf4j.Slf4j;

@Slf4j
@RestController
@RequestMapping("/JFS")
public class JfsController {
	
	@Autowired
	private TblCqpntPointInFlowService tblCqpntPointInFlowService;
	
	@Autowired
	private TIndicatorsService tIndicatorsService;
	
	@Autowired
	private TblPointActivityService tblPointActivityService;
	
	@Autowired
	private TblChaccCommPriAcctInfService  tblChaccCommPriAcctInfService;
	
	@Autowired
	private JfsService JfsService;
	
	
	//非货币积分发放金额浮动比率
	@RequestMapping("/JFS_M001")
	@ResponseBody
	@TBatchLog("JFS_M001")
	@Resubmit(delaySeconds = 10)
	public Result JFS_M001(String strDate) {
		try {
			String DateTime = strDate;
			if(StringUtils.isEmpty(DateTime)) {
				//如果是空 默认当前时间
				DateTime = DateUtil.getToday();			
			}
			//非货币积分发放金额浮动比率
		    JfsService.getJFS_M001( DateTime);
		} catch (Exception e) {
			// TODO: handle exception
			return new Result().error();
		}
		return new Result().ok();
	}
	// 非人民币货币积分发放金额浮动比率
	@RequestMapping("/JFS_M002")
	@ResponseBody
	@TBatchLog("JFS_M002")
	@Resubmit(delaySeconds = 10)
	public Result JFS_M002(String strDate) {
		try {
			String DateTime = strDate;
			if(StringUtils.isEmpty(DateTime)) {
				//如果是空 默认当前时间
				DateTime = DateUtil.getToday();			
			}
			JfsService.getJFS_M002( DateTime);	
		 
		} catch (Exception e) {
			// TODO: handle exception
			return new Result().error();
		}
		return new Result().ok();
	
	}
	// 事后结算积分发放金额浮动比率
	@RequestMapping("/JFS_M003")
	@ResponseBody
	@TBatchLog("JFS_M003")
	@Resubmit(delaySeconds = 10)
	public Result JFS_M003(String strDate) {
		try {
			String DateTime = strDate;
			if(StringUtils.isEmpty(DateTime)) {
				//如果是空 默认当前时间
				DateTime = DateUtil.getToday();			
			}
			  JfsService.getJFS_M003( DateTime);
		
		} catch (Exception e) {
			// TODO: handle exception
			return new Result().error();
		}
		return new Result().ok();
		
	}
	 // 单用户货币积分余额> N浮动比率
	@RequestMapping("/JFS_M004")
	@ResponseBody
	@TBatchLog("JFS_M004")
	@Resubmit(delaySeconds = 10)
	public Result JFS_M004(String strDate) {
		try {
			String DateTime = strDate;
			if(StringUtils.isEmpty(DateTime)) {
				//如果是空 默认当前时间
				DateTime = DateUtil.getToday();			
			}
			JfsService.getJFS_M004( DateTime);
			
		} catch (Exception e) {
			// TODO: handle exception
			return new Result().error();
		}
		return new Result().ok();
	}
	// 单用户非货币积分余额> N浮动比率
	@RequestMapping("/JFS_M005")
	@ResponseBody
	@TBatchLog("JFS_M005")
	@Resubmit(delaySeconds = 10)
	public Result JFS_M005(String strDate) {
		try {
			String DateTime = strDate;
			if(StringUtils.isEmpty(DateTime)) {
				//如果是空 默认当前时间
				DateTime = DateUtil.getToday();			
			}
			  // 单用户非货币积分余额> N浮动比率
		    JfsService.getJFS_M005( DateTime);
			} catch (Exception e) {
				// TODO: handle exception
				return new Result().error();
			}
	return new Result().ok();
	}
	// 临时用户（非注册用户,即不使用userID用户）交易数量浮动比	
	@RequestMapping("/JFS_M006")
	@ResponseBody
	@TBatchLog("JFS_M006")
	@Resubmit(delaySeconds = 10)
	public Result JFS_M006(String strDate) {
		try {
			String DateTime = strDate;
			if(StringUtils.isEmpty(DateTime)) {
				//如果是空 默认当前时间
				DateTime = DateUtil.getToday();			
			}
			// 临时用户（非注册用户,即不使用userID用户）交易数量浮动比										
		    JfsService.getJFS_M006( DateTime);

		} catch (Exception e) {
			// TODO: handle exception
			return new Result().error();
		}
	return new Result().ok();
	}
	 // 积分余额为负数量	
	@RequestMapping("/JFS_M007")
	//@ResponseBody
	@TBatchLog("JFS_M007")
	@Resubmit(delaySeconds = 10)
	public Result JFS_M007(String strDate) {
		try {
			String DateTime = strDate;
			if(StringUtils.isEmpty(DateTime)) {
				//如果是空 默认当前时间
				DateTime = DateUtil.getToday();			
			}
			 // 积分余额为负数量				
		    JfsService.getJFS_M007( DateTime);

			} catch (Exception e) {
				// TODO: handle exception
				return new Result().error();
			}
	    return new Result().ok();
	}

	

	
}